/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: jse2204 - Var
 * <p>Powered by webrx On 2022-08-29 13:55:49
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Var {
    //属性，成员属性，成员变量，会自动的初始化
    int age;
    String addr = "河南省郑州";


    //类变量，成员属性
    static int num = 16;

    public static void main(String[] args) {
        var x = 5;//java 10
        var y = "ok";

        //声明一个int类型的局部变量，并初始化值为30;
        int i = 50;
        System.out.println(i);
        System.out.println("i");
        System.out.println(i);
        System.out.println(i);
        System.out.println("i");
        System.out.println(i);
        System.out.println(i);
        System.out.println(50);

        //java 是强类型语言，变量声明的时候类型必须确定
        i = 3;
        //i = "ok";字符串
        //i = .5;双精度double
        //i = true;布尔型
        i = 'a'; //字符型
        System.out.println(i);

        System.out.println((int) '中');
        System.out.println((char) 20013);

        {
            {
                //局部变量，作用域在当前的{}括号内
                int c = 1;
            }
            int c = 50;
            System.out.println(c);
        }


    }
}
